home *** CD-ROM | disk | FTP | other *** search
- /*
- | file name -- VUtextarray.h
- |====================================================================
- |
- | copyright (c) 1990, V.I. corporation
- |
- | VUtextarray - Types, macros, and defines for using VUtextarray
- |
- | charlie goldensher 6 Feb 90
- | M.Krasnik 3 Jan 91 Add cursor style enum.
- | M.Krasnik 19 Feb 91 Add area type enum.
- | M.Krasnik 19 Feb 91 Get rid of NULL_ENUM.
- | Textronics compiler does not support
- | enums with members of the same name.
- |====================================================================
- */
- #ifndef VUTEXTARRAY_H
- #define VUTEXTARRAY_H
- #include "std.h"
-
-
- /********************** Common Data Structures *********************/
-
- /* Character position within a text array */
- typedef struct TA_POSITION
- { short row, col; } TA_POSITION;
-
- /* Rectangular region within a text array */
- typedef struct TA_RECT
- { TA_POSITION ul, lr; } TA_RECT;
-
- /* Foreground and background colors packed together */
- typedef UBYTE TA_PACKED_COLOR;
-
- /* The public text array data structure */
- typedef ADDRESS TEXTARRAY;
-
-
- /************** Macros for processing a TA_POSITION **************/
-
- /* Assign (new) values to a TA_POSITION.
- | Returns that TA_POSITION. */
- #define V_TPSET(tp,r,c) ( (tp)->row = (r), (tp)->col = (c), (tp) )
-
- /* Add the given values to a TA_POSITION. Returns that TA_POSITION. */
- #define V_TPADD(tp,r,c) ( (tp)->row += (r), (tp)->col += (c), (tp) )
-
- /* Copy values of one TA_POSITION to another. Return dest TA_POSITION */
- #define V_TPCOPY(dst,src) ( (dst)->row = (src)->row, \
- (dst)->col = (src)->col, (dst) )
-
-
- /**************** Macros for processing a TA_RECT ****************/
-
- /* Assign (new) values to a TA_RECT. Returns that TA_RECT. */
- #define V_TRSET(tr,ulrow,ulcol,lrrow,lrcol) \
- ( (tr)->ul.row = (ulrow), (tr)->ul.col = (ulcol),\
- (tr)->lr.row = (lrrow), (tr)->lr.col = (lrcol),\
- (tr) )
-
- /* Add the given values to a TA_RECT. Returns that TA_RECT. */
- #define V_TRADD(tr,ulrow,ulcol,lrrow,lrcol) \
- ( (tr)->ul.row += (ulrow), (tr)->ul.col += (ulcol),\
- (tr)->lr.row += (lrrow), (tr)->lr.col += (lrcol),\
- (tr) )
-
- /* Copy values of one TA_RECT to another. Return dest TA_RECT */
- #define V_TRCOPY(dst,src) ( (dst)->ul.row = (src)->ul.row, \
- (dst)->ul.col = (src)->ul.col, \
- (dst)->lr.row = (src)->lr.row, \
- (dst)->lr.col = (src)->lr.col, \
- (dst) )
-
- /* Returns width of TA_RECT. */
- #define V_TRWIDTH(tr) ( (tr)->lr.col - (tr)->ul.col + 1 )
-
- /* Returns height of a TA_RECT */
- #define V_TRHEIGHT(tr) ( (tr)->lr.row - (tr)->ul.row + 1 )
-
-
- /*** Macros for packing and unpacking character color attributes ***/
-
- #define V_PACK_COLOR(fore,back) ((((fore) & 0xf)<<4)|((back) & 0xf))
- #define V_UNPACK_COLOR( color, fore, back ) \
- ( (fore) = (color)>>4 & 0xf, \
- (back) = (color) & 0xf, \
- (color) )
-
-
- /********************** Text Array Constants ***********************/
-
- /* Number of colors available for text array */
- #define V_TA_NUM_COLORS 16
-
- /* prepacked text colors */
- #define V_TA_NORMAL 0x10 /* color[1] on color[0] */
- #define V_TA_INVERSE 0x01 /* color[0] on color[1] */
-
-
- /* Bit-flag definitions for spec_flag passed to VUtaCreate().
- | These flags are (bitwise) or'd together and used as spec flag.) */
-
- /* Orientation Point: where anchor point is to be fixed */
- #define V_OP_BITS 0x0F /* bits defining orientation point */
- #define V_OP_TOP 0x01 /* top */
- #define V_OP_BOTTOM 0x02 /* bottom */
- #define V_OP_LEFT 0x04 /* left */
- #define V_OP_RIGHT 0x08 /* right */
- #define V_OP_LL (V_OP_BOTTOM|V_OP_LEFT) /* lower left */
- #define V_OP_LR (V_OP_BOTTOM|V_OP_RIGHT)/* lower right */
- #define V_OP_UL (V_OP_TOP|V_OP_LEFT) /* upper left */
- #define V_OP_UR (V_OP_TOP|V_OP_RIGHT) /* upper right */
- #define V_OP_CENTERED 0x00 /* centered */
-
- /* Resolution of conflicts betw scr (szscr) and char (szchr) size. */
- #define V_RSLVE_BITS 0x30 /* all resolution bits */
- #define V_RSLVE_X_GREATER 0x10 /* greater of two in x dir */
- #define V_RSLVE_Y_GREATER 0x20 /* greater of two in y dir */
- #define V_RSLVE_X_LESSER 0x00 /* lesser of two in x dir */
- #define V_RSLVE_Y_LESSER 0x00 /* lesser of two in y dir */
- #define V_RSLVE_GREATER (V_RSLVE_X_GREATER|V_RSLVE_Y_GREATER)/* > */
- #define V_RSLVE_LESSER (V_RSLVE_X_LESSER|V_RSLVE_Y_LESSER) /* < */
-
- /* What to do with slop */
- #define V_SLOP_BITS 0x3C0 /* what to do with slop */
- #define V_SLOP_X_SHRINK 0x040 /* shrink: discard slop in the x-dir */
- #define V_SLOP_Y_SHRINK 0x080 /* shrink: discard slop in the y-dir */
- #define V_SLOP_X_LEAVE 0x000 /* leave slop alone in the x-dir */
- #define V_SLOP_Y_LEAVE 0x000 /* leave slop alone in the y-dir */
- #define V_SLOP_X_EXPAND 0x100 /* expand: include slop in the x-dir */
- #define V_SLOP_Y_EXPAND 0x200 /* expand: include slop in the y-dir */
- #define V_SLOP_SHRINK (V_SLOP_X_SHRINK|V_SLOP_Y_SHRINK)/* shrink */
- #define V_SLOP_LEAVE (V_SLOP_X_LEAVE|V_SLOP_Y_LEAVE) /* leave */
- #define V_SLOP_EXPAND (V_SLOP_X_EXPAND|V_SLOP_Y_EXPAND)/* expand */
-
- /* Cursor styles */
- typedef enum
- {
- V_UTA_UNDERSCORE=1,
- V_UTA_REVERSE,
- V_UTA_COLOR
- } V_UTA_CURSOR_ENUM;
-
- typedef enum
- {
- V_UTA_RECTANGLE=1,
- V_UTA_AREA
- } V_UTA_AREA_ENUM;
-
- #endif /* VUTEXTARRAY_H */
-
-
-
-
-
-